%h2=_ "Add comment" 
= error_messages_for(:comment) 
- @media = Media.find_by_id(@comment.media_id)
= render :partial => 'media/post' 
- @previous_comments=Comment.find_all_by_media_id(@comment.media_id,:conditions=>"published=1") 
- for pcomment in @previous_comments 
  .comment
    %p.comment_details
      =_ "posted"
      = ":"
      =_ '(date)',pcomment.creation
      = " "
      =_ "by"
      = ":"
      = pcomment.name
    .comment_text
      = RedCloth.new(HTMLEntities.decode_entities(pcomment.comment)).to_html
- form_tag :action => 'create' do
  = hidden_field 'comment', 'media_id',:value => params[:id] 
  %p
    %label{:for=>"comment_name"}
      =_ "Name"
    = "<br/>"
    = text_field 'comment', 'name'
  %p
    %label{:for=>"comment_email"}
      =_ "Email" 
    = "<br/>"
    = text_field 'comment', 'email' 
  %p
    %label{:for=>"comment_comment"}
      =_ "Comment"
    = "<br/>"
    = text_area 'comment', 'comment',:cols=>80 
  %p
    %label{:for=>"validation_code"}
      =_ "Enter result of "
      = ":"
      = session["oper3"].to_s+session["sign2"]+session["oper4"].to_s 
    = text_field 'validation','',:value=>"" 
  = submit_tag _("Create") 
= link_to _('Back'), :controller =>"media", :action => 'list'

